/*
 * trypsyn_dsp.h
 * This file is part of trypsyndsp
 *
 * Copyright (C) 2012 - Luke William Westby
 *
 * trypsyndsp is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * trypsyndsp is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with trypsyndsp. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef TRYPSYN_DSP_H
#define TRYPSYN_DSP_H

#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif

// fixed-width bitfeilds
typedef uint32_t trypsyn_syncint32_t;
typedef uint32_t trypsyn_uint32_t;
typedef uint16_t trypsyn_uint16_t;
typedef uint8_t trypsyn_uint8_t;

// error codes
#define TRYPSYN_ERROR_NONE 0
#define TRYPSYN_ERROR_MEM 1
#define TRYPSYN_ERROR_INVFILE 2
#define TRYPSYN_ERROR_NULLARG 3
#define TRYPSYN_ERROR_NOFILE 4
#define TRYPSYN_ERROR_NOID3 5
#define TRYPSYN_ERROR_BADREAD 6

// top-level functions
int trypsyn_open(char *file_name, int *file_type, FILE **fp);
void trypsyn_error(int error_code, int line, char *file);

#endif
